package com.example.a2007dou_shop.net

import com.example.a2007dou_shop.entity.*
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

interface ApiServer {
    @GET(Cons.SENDRCODE_URL)
    suspend fun sendrcode(@Query("phone")phone:String):SendCodeEntity
    @POST(Cons.CHECKRCODE_URL)
    suspend fun checkrcode(@Body body: RequestBody):SendCodeEntity
    @POST(Cons.REGISTER_URL)
    suspend fun register(@Body body: RequestBody):SendCodeEntity
    @POST(Cons.LOGIN_URL)
    suspend fun login(@Body body: RequestBody):LoginEntity
    @GET(Cons.SENDLCODE_URL)
    suspend fun sendlcode(@Query("phone")phone:String):SendCodeEntity
    @POST(Cons.LOGIN_CODE_URL)
    suspend fun logincode(@Body body: RequestBody):LoginEntity
    @GET(Cons.LOGOUT_URL)
    suspend fun logout():LoginEntity

    @GET(Cons.VIDEO_URL)
    suspend fun getvideo(@Query("order")order:String,@Query("page")page:Int,@Query("size")size:Int):VideoEntityResult
   // @GET(Cons.LOVE_URL)
    suspend fun love(@Query("vid")vid:Int):LoveEntity

   // @GET(Cons.COMMENTS_URL)
    suspend fun comments(@Query("vid")vid: Int):CommentEntityResult
    //@POST(Cons.SAVECOMMENT_URL)
    suspend fun savecomment(@Body body:RequestBody):LoveEntity

    @GET(Cons.VIDEO_URL)
    suspend fun getVideos(@Query("currentPage")currentPage:Int,@Query("pageSize")pageSize:Int):VideosEntityResult
    @GET(Cons.FIND_URL)
    suspend fun findVideos(@Query("keywords")keywords:String):VideosEntityResult
    @GET(Cons.GETCOMMENT_URL)
    suspend fun getComment(@Query("videoId")videoId:Int):CommentEntityResult

    @POST(Cons.SENDCOMMENT_URL)
    suspend fun sendComment(@Body body: RequestBody):CommentEntityResult
}